import 'package:easydouban/generated/json/base/json_field.dart';
import 'package:easydouban/generated/json/i_top_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class ITopEntity {

	late List<ITopData> data;
	late int createdAt;
	late int updatedAt;
	late String id;
	late String originalName;
	late int imdbVotes;
	late String imdbRating;
	late String rottenRating;
	late int rottenVotes;
	late String year;
	late String imdbId;
	late String alias;
	late String doubanId;
	late String type;
	late String doubanRating;
	late int doubanVotes;
	late int duration;
	late String dateReleased;
  
  ITopEntity();

  factory ITopEntity.fromJson(Map<String, dynamic> json) => $ITopEntityFromJson(json);

  Map<String, dynamic> toJson() => $ITopEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ITopData {

	late int createdAt;
	late int updatedAt;
	late String id;
	late String poster;
	late String shareImage;
	late String name;
	late String genre;
	late String description;
	late String language;
	late String country;
	late String lang;
	late String movie;
  
  ITopData();

  factory ITopData.fromJson(Map<String, dynamic> json) => $ITopDataFromJson(json);

  Map<String, dynamic> toJson() => $ITopDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}